#! /bin/bash
#ods_to_dim_init.sh
dim_user_zip="
insert overwrite table dim_user_zip partition (dt = '9999-12-31')
select
    data.id,
    data.login_name		,
    data.nick_name		,
    data.passwd			,
    data.real_name		,
    data.phone_num		,
    data.email			,
    data.head_img		,
    data.user_level		,
    data.birthday		,
    data.gender			,
    data.create_time	,
    date_format(nvl(data.operate_time,data.create_time),'yyyy-MM-dd')	start_time,
    "9999-12-31" end_time
from ods_user_info_inc where dt = '{do_date}'
and type='bootstrap-insert';
"
/opt/module/hive/bin/hive -e "use edu;${dim_user_zip};"